<?php

use think\migration\db\Column;
use think\migration\Migrator;

class CreateFailedJobsTable extends Migrator
{
    public function change()
    {
        $this->table('failed_jobs', ['comment' => '失败队列', 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci'])
            ->addColumn(Column::text('connection'))
            ->addColumn(Column::text('queue'))
            ->addColumn(Column::longText('payload'))
            ->addColumn(Column::longText('exception'))
            ->addColumn(Column::timestamp('fail_time')->setDefault('CURRENT_TIMESTAMP'))
            ->create();
    }
}
